//
//  WebExample.swift
//  SwiftCode
//
//  Created by yuhus on 2024/3/27.
//

import Foundation

class WebExample: ListViewController {
  override func getItemCount() -> Int {
    data.count
  }
  
  override func getItem(_ indexPath: IndexPath) -> Item {
    data[indexPath.row]
  }
  
  static let url = URL(string: "https://www.baidu.com/")!
  
  private lazy var data: [Item] = [
    .init(title: "Image Previewer", description: "图片预览", action: { [weak self] in
      self?.showWeb(.init(url: Self.url, title: "", showTitle: false, isTranTop: false))
    }),
  ]
  
  private func showWeb(_ args: WebParam) {
    self.navigationController?.pushViewController(WebViewController(args), animated: true)
  }
}
